package cn.jsj.cases.dispose;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 案件提示信息处理类
 * 产生一些案件提示信息 比如：某个案件就要开庭了，某个案件要付款了！
 * @author LI
 *
 */
 public class CasePointInfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	 public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("案件提示信息！");

		 //判断用户类型
		 javax.servlet.http.HttpSession session=request.getSession();
		 String roleName=(String)session.getAttribute("roleName");

		 //输出流
		 java.io.PrintWriter out=response.getWriter();

		 //如果为律师
		 if(roleName.equalsIgnoreCase("律师")){
			 //获取律师ID
			 int lawyerId=(Integer)session.getAttribute("userId");

			 //获取他有关即将开庭的案件信息
			 cn.jsj.dao.TblCaseInfoDAO tcid=new cn.jsj.dao.TblCaseInfoDAO();
			 String caseNumberSet=tcid.getLawerselfCourtInfo(lawyerId);
			 out.println("{message:'"+caseNumberSet+"'}");
			 out.flush();
			 out.close();
			 return;
		 }

		 //如果为行政人员
		 if(roleName.equalsIgnoreCase("行政人员")){
			 //获取所有即将开庭的案件信息和付款信息
			 cn.jsj.dao.TblCaseInfoDAO tcid=new cn.jsj.dao.TblCaseInfoDAO();
			 String resultString=tcid.getCourtPayFuture();
			 out.println("{message:'"+resultString+"'}");
			 out.flush();
			 out.close();
			 return;
		 }
	}
}